package com.tx.activemq.service.impl;

import com.tx.activemq.DefaultMessage;
import com.tx.activemq.DefaultMessageCreator;
import com.tx.activemq.service.ProviderService;
import org.springframework.jms.core.JmsTemplate;

import javax.annotation.Resource;
import javax.jms.Destination;

public class ProviderServiceImpl implements ProviderService {

    @Resource
    private JmsTemplate jmsTemplate;

    //    @Resource(name = "testQueue")
    @Resource(name = "testTopic")
    private Destination destination;

    @Override
    public void sendMsg() {
        jmsTemplate.send(destination, DefaultMessageCreator.getInstance(DefaultMessage.getInstance()));
    }
}
